/**
 * 
 */
package zeroj.web.action;

import java.util.HashMap;
import java.util.Map;

/**
 * @author LYL(lylsir at gmail dot com)
 *
 */
public class ActionContext {

	private static ThreadLocal<ActionContext> contextLocal = new ThreadLocal<ActionContext>();
	private Map<Object, Object> vars = new HashMap<Object, Object>();
	
	public static ActionContext get() {
		
		ActionContext context = contextLocal.get();
		if(context == null) {
			context = new ActionContext();
			contextLocal.set(context);
		}
		return context;
	}
	
	public void set(Object key, Object value) {
		
		vars.put(key, value);
	}
	
}
